﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using System.Collections.ObjectModel;

namespace RoboTrocity {
	class TextureDispenser {
		static Dictionary<String, Texture2D> textures = new Dictionary<String, Texture2D>();
		
		public static void initialize() {
			textures = new Dictionary<String, Texture2D>(); 
		}

		public static void addNullTexture(string _textureName) {
			addTexture(_textureName, null);
		}

		public static void addTexture(string _textureName, Texture2D _texture) {
			if (getTexture(_textureName) == null) {
				textures.Add(_textureName, _texture);
			}	
		}

		public static void removeTexture(string _textureName) {
			textures.Remove(_textureName);
		}

		public static void loadTexture(string _textureName, Texture2D _texture) {
			textures[_textureName] = _texture;
		}

		public static Texture2D getTexture(string _textureName) {
			Texture2D returnTexture;
			textures.TryGetValue(_textureName, out returnTexture);
			return returnTexture;
		}

		public static Dictionary<String, Texture2D>.KeyCollection TextureNames {
			get { return textures.Keys; }
		}

		public static Dictionary<String, Texture2D>.ValueCollection Textures {
			get { return textures.Values; }
		}

		
	}
}
